<template>
  <view class="container">
    <view class="com-bg">
      <view class="com">
        <view class="com-top">
          <view class="com-top-left">
            <text class="text">账户余额(元)</text>
            <text class="balance">88888</text>
          </view>
          <view class="com-top-right">
            <image src="https://zrws-1327345771.cos.ap-shanghai.myqcloud.com/yanxue/coin.png" mode="scaleToFill" />
          </view>
        </view>
        <view class="com-bottom">
          <view class="bottom-item">
            <view class="label">你的招生人数</view>
            <view class="content">4人</view>
          </view>
          <view class="bottom-item">
            <view class="label">裂变人数</view>
            <view class="content">4人</view>
          </view>
          <view class="bottom-item">
            <view class="label">昨日收入</view>
            <view class="content">8888</view>
          </view>
        </view>
      </view>
    </view>
    <view class="com-detail">
      <view class="label">提现金额</view>
      <view class="money">
        <view
          class="money-item"
          :class="{ active: currentIndex === index }"
          v-for="(item, index) in moneys"
          :key="index"
          @click="itemClick(item, index)"
        >
          <text class="unit" v-if="index !== moneys.length - 1">￥</text>
          <text class="num">{{ item }}</text>
        </view>
      </view>
      <view class="input">
        <view class="unit-fixed">￥</view>
        <input placeholder-style="color:#BBBBBB;fontsize:27rpx" type="number" placeholder="请输入提现金额" />
      </view>
      <view class="btn">提现</view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      moneys: [100, 200, 500, 1000, 2000, "全部"],
      currentIndex: 0,
    };
  },
  methods: {
    itemClick(item, index) {
      this.currentIndex = index;
    },
  },
};
</script>

<style lang="scss" scoped>
.container {
  background-color: #f6f6f6;
}

.com-bg {
  width: 100%;
  height: 416rpx;
  background: linear-gradient(0deg, #c1f26c 0%, #ffffff 100%);
  border-radius: 60rpx;

  .com {
    width: 702rpx;
    height: 368rpx;
    background: #ffffff;
    border-radius: 48rpx;
    margin: 0 auto;
    margin-top: 24rpx;

    .com-top {
      display: flex;
      justify-content: space-between;
      width: 702rpx;
      height: 240rpx;
      background: linear-gradient(0deg, #ffa233 0%, #f95513 100%);
      border-radius: 48rpx;
      padding: 30rpx 60rpx 0 48rpx;

      .com-top-left {
        display: flex;
        flex-direction: column;
        text-align: left;

        .text {
          font-family: HarmonyOS Sans SC;
          font-weight: 400;
          font-size: 23rpx;
          color: #fffefe;
        }

        .balance {
          font-family: HarmonyOS Sans SC;
          font-weight: 400;
          font-size: 86rpx;
          color: #fffefe;
          margin-top: 44rpx;
        }
      }

      .com-top-right {
        display: flex;
        justify-content: center;
        align-items: center;
        image {
          width: 256rpx;
          height: 246rpx;
          margin-top: -60rpx;
        }
        .btn {
          width: 169rpx;
          height: 64rpx;
          background: #ffffff;
          border-radius: 32rpx;
          font-family: HarmonyOS Sans SC;
          font-weight: 500;
          font-size: 37rpx;
          color: #f95513;
          text-align: center;
          line-height: 64rpx;
        }
      }
    }

    .com-bottom {
      display: flex;
      justify-content: space-between;
      padding: 0 62rpx;
      margin-top: 20rpx;

      .bottom-item {
        display: flex;
        flex-direction: column;
        text-align: left;

        .label {
          font-family: HarmonyOS Sans SC;
          font-weight: 400;
          font-size: 23rpx;
          color: #f95513;
          text-align: center;
          line-height: 23rpx;
        }

        .content {
          font-family: HarmonyOS Sans SC;
          font-weight: 500;
          font-size: 50rpx;
          color: #f95513;
          margin-top: 22rpx;
          line-height: 50rpx;
        }
      }
    }
  }
}

.com-detail {
  width: 702rpx;
  background: #ffffff;
  box-shadow: -4rpx 0rpx 19rpx 1rpx rgba(52, 52, 52, 0.15);
  border-radius: 48rpx;
  overflow: hidden;
  margin: 0 auto;
  padding: 30rpx 40rpx;

  .input {
    width: 610rpx;
    height: 96rpx;
    background: #f8f8f8;
    border-radius: 20rpx;
    margin-top: 24rpx;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 28rpx 30rpx;

    .unit-fixed {
      font-family: HarmonyOS Sans SC;
      font-weight: 500;
      font-size: 40rpx;
      color: #f95513;
      margin-right: 28rpx;
    }

    input {
      width: 100%;
      height: 100%;
      background: #f8f8f8;
      border: none;
      font-family: HarmonyOS Sans SC;
      font-weight: 500;
      font-size: 34rpx;
      color: #010101;
      padding-left: 28rpx 30rpx;
      position: relative;
    }
  }

  .label {
    font-family: HarmonyOS Sans SC;
    font-weight: 500;
    font-size: 34rpx;
    color: #010101;
    display: flex;
    align-items: center;
  }

  .label::before {
    content: "";
    display: block;
    width: 12rpx;
    height: 46rpx;
    background: #f95513;
    border-radius: 6rpx;
    margin-right: 28rpx;
  }

  .money {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 30rpx;
    margin-top: 52rpx;

    .money-item.active {
      background: #f95513;
    }

    .money-item {
      width: 190rpx;
      height: 96rpx;
      background: #ffe0d3;
      border-radius: 20rpx;
      display: flex;
      align-items: center;
      justify-content: center;

      .unit {
        font-family: HarmonyOS Sans SC;
        font-weight: 500;
        font-size: 28rpx;
        color: #ffffff;
      }

      .num {
        font-family: HarmonyOS Sans SC;
        font-weight: 500;
        font-size: 50rpx;
        color: #ffffff;
      }
    }
  }

  .btn {
    background: #f95513;
    border-radius: 59rpx;
    font-family: HarmonyOS Sans SC;
    font-weight: 400;
    font-size: 38rpx;
    color: #fffefe;
    text-align: center;
    line-height: 118rpx;
    margin-top: 100rpx;
  }
}
</style>
